const router = require("koa-router")();
const userController = require("../controller/user");
const userLogin = require("../controller/login");

router.prefix("/users");

//crud
router.post("/add", userController.useradd);
router.post("/update", userController.userupdate);
router.post("/del", userController.userdel);
router.get("/find", userController.userfind);
router.get("/find/:id", userController.findById);

//login
router.post("/login", userLogin.userLogin);

//注册
router.post("/register", userLogin.userRegister);

module.exports = router;
